]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Ensure style for icon size computation
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 13 Oct 2015 15:38:26 +0000 (17:38 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 13 Oct 2015 18:21:44 +0000 (20:21 +0200)
StIcon will skip loading the texture when its theme node is unset (which
may happen on style changes while the widget is hidden). While our size
request to compute the dash icon size will create the icon's theme node
if necessary (and of all its parents), a missing texture can still throw
off our computation.
Make sure this doesn't happen by ensuring the icon's style first, so the
texture is updated in response to StWidget::style-changed if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=745649

js/ui/dash.js

index e809f87ab329a2f76642e4b798a0041dd17db283..db23a3b6640afdb044af9a260223e5f86a30a2ad 100644 (file)
@@ -647,6 +647,7 @@ const Dash = new Lang.Class({
         let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
 
         // Enforce the current icon size during the size request
+        firstIcon.icon.ensure_style();
         let [currentWidth, currentHeight] = firstIcon.icon.get_size();
         firstIcon.icon.set_size(this.iconSize * scaleFactor, this.iconSize * scaleFactor);
         [minHeight, natHeight] = firstButton.get_preferred_height(-1);